package com.wwg.threads.binghe.concurrent.executor.callable;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @Description: 回调实现
 * @Param:  TaskResult<R> 回调数据模型
 * @return:
 * @Author: wwg
 * @Date: 2021/6/4
 */
public class CallableHandler extends AbstractCallable<TaskResult<ResultParams>>{

    private static final Logger LOGGER = LoggerFactory.getLogger(CallableHandler.class);

    private TaskResult<ResultParams> taskResult;

    public TaskResult<ResultParams> getTaskResult() {
        return taskResult;
    }

    public void setTaskResult(TaskResult<ResultParams> taskResult) {
        this.taskResult = taskResult;
    }

    @Override
    public void call(TaskResult<ResultParams> taskResult) {
//        LOGGER.info("回调结果如下: {}",taskResult);
        this.taskResult = taskResult;
    }
}
